home *** CD-ROM | disk | FTP | other *** search
- GEM++ - C++ LIBRARIES FOR GEM/AES/VDI
-
-
-
- NAME
- GEMobject - Extensible objects in forms.
-
- DESCRIPTION
- The standard GEM OBJECTs (defined in gemfast.h of the standard C
- library) that are used in C are a fixed structure that can be
- extended in various ways - extended types, indirect object-specific
- data, and user defined object types.
-
- A GEMobject is implemented using the indirect object-specific
- data, and uses two bits of the extended type, but is a fully
- extensible C++ object - you can use derived classes to
- implement any extensions possible with plain C OBJECTs, plus
- any other features you devise, and all of your objects will
- be fully compatible with any objects created by other people
- using GEM++.
-
- A GEMobject is also tightly coupled to the GEMform, since the
- GEMform is composed of GEMrawobjects and each GEMrawobject may
- have a GEMobject declared to be attached to it. The GEMobject
- receives call-backs through its Touch() method from the GEMform.
- This makes a GEMobject an active part of an application rather
- than just a block of data. See the Cook() member of GEMrawobject.
-
- GEMobjects make GEM truly object-oriented.
-
- CONSTRUCTORS
- GEMobject(GEMform&, int RSCindex)
- Create a GEMobject that is a component of the given GEMform,
- controlling the object in that form specified by the given
- RSC index.
-
- METHODS
- virtual GEMfeedback Touch(int x, int y, const GEMevent& e)
- Call-back method. This method is called when the object is
- manipulated by the user as part of a GEMform (or GEMformwindow,
- or GEMmenu, or GEMdesktop, etc). (x,y) is the relative
- position of the click - (0,0) is the top-left corner of the
- object. The absolute position is available in the provided
- GEMevent, as is information as to which mouse button was
- used, how many clicks occurred, and which meta-keys where
- being pressed when the object was manipulated. By default,
- this method simply returns EndInteraction. This is the
- primary method for extensibility.
-
- bool Selected(bool s); bool Selected(); void Select(); void Deselect()
- bool Crossed(bool s); bool Crossed(); void Cross(); void Uncross()
- bool Checked(bool s); bool Checked(); void Check(); void Uncheck()
- bool Disabled(bool s); bool Disabled(); void Disable(); void Enable()
- bool Outlined(bool s); bool Outlined(); void Outline(); void Unoutline()
- bool Shadowed(bool s); bool Shadowed(); void Shadow(); void Unshadow()
- These methods test-and-set / test / set / reset the various
- states of the object respectively. They do not cause redraw.
-
- bool Selectable(bool f); bool Selectable()
- bool Default(bool f); bool Default()
- bool Exit(bool f); bool Exit()
- bool Editable(bool f); bool Editable()
- bool RadioButton(bool f); bool RadioButton()
- bool LastObject(bool f); bool LastObject()
- bool TouchExit(bool f); bool TouchExit()
- bool HideTree(bool f); bool HideTree()
- These methods test-and-set / test the various flags of the object.
- These flags do not effect the visual representation of an object,
- so redraw is not required.
-
- short States()
- short Flags()
- These methods return the current state and flags respectively.
-
- bool ContainsPoint(int x, int y)
- True iff the given point is within the absolute area of the
- object.
-
- void MoveTo(short x, short y)
- Moves the object to the given position relative to the parent
- of the object.
-
- void MoveBy(short x, short y)
- Moves the object by the given amount.
-
- short X()
- short Y()
- Return the position of the object relative to the parent.
-
- void GetAbsoluteXY(int& x, int& y) const;
- Return the absolute screen position of the object.
-
- short Width()
- short Height()
- Examine the size of the object, in pixels.
-
- void Resize(short w, short h)
- virtual void SetWidth(short w)
- virtual void SetHeight(short h)
- Set the size of the object in pixels.
-
- virtual void Type(int)
- virtual int Type()
- Set or examine the object type (see gemfast.h)
-
- virtual int ObjectSpecific()
- virtual void ObjectSpecific(int)
- Set or examine the object-specific data (see gemfast.h)
- Note that since GEMobjects use indirect object-specific data,
- these methods are setting or examining the indirect data,
- not the pointer to the data.
-
- char* ImageBitmap(bool Mask=FALSE)
- Returns the bitmap data or mask of the object. IMAGE type objects
- have no mask. ICON type objects have both.
-
- short ImageHeight()
- short ImageWidth()
- Return the size of the IMAGE or ICON graphic.
-
- void SetImageBitmap(char*, short w, short h, bool Mask=FALSE)
- Sets the data or mask of the object to be the given area of
- memory, with the given pixel width and height.
-
- char* Text()
- Returns the text of the object. For STRING type objects, this
- is the text of the string. For TEXT objects, it is the text.
- For FTEXT objects, it is the user-input text. For CHAR objects,
- a pointer to that char is returns. Note that this methods
- returns a pointer to the actual string, which may then be
- modified in-place, etc. note also that the "CHAR" object
- "string" is not NUL terminated (since it is a single character).
-
- void SetText(char*)
- Sets the text of an object, as above. Note that this sets
- the pointer in the object to the given pointer, except for
- the ICON type, where the first character of the given string
- is copied.
-
- int FillPattern()
- Returns the fill pattern of the object.
-
- int Font()
- void Font(int font)
- Set/get the font for the object. The value returned is as
- defined in gemfast.h (IBM or SMALL).
-
- int ForeCol()
- void ForeCol(int colourindex)
- int BackCol()
- void BackCol(int colourindex)
- Set/get the foreground or background colours of the object.
-
- void Redraw()
- void RedrawParent()
- Redraw the object (or its parent). Note that for transparent
- objects, the parent must be redraw in order for the display
- to be correct.
-
- void Detach()
- Remove from parent child-list
- void Attach(GEMobject& o)
- Attach child to self, by object.
- void Attach(int RSCindex)
- Attach child to self, by index.
-
- int NumberOfChildren()
- Returns the number of children of the object, including those
- that are- and are-not GEMobjects.
- int FirstChild()
- Returns the index of the first child, or -1 if none.
- int NextChild(int after)
- Returns the child after the given child.
- GEMrawobject* Child(int)
- Returns the given child as a pointer to a GEMrawobject.
- int Index()
- Returns the index of the object.
-
- int NumberOfComponents()
- Returns the number of GEMobjects that are children of the object.
- GEMobject* FirstComponent()
- Returns the first GEMobject that is a child of the object, or NULL.
- GEMobject* NextComponent(const GEMobject*)
- Returns the next GEMobject after the given child object, or NULL.
-
- SEE ALSO
- GEMrawobject, GEMform,
- GEMimageobject, GEMtextobject, GEMuserobject, GEMvdiobject, GEMslider
-
- BUGS
- Bugs in GEM++ should be reported to warwick@cs.uq.oz.au
-
- AUTHOR
- Warwick Allison, 1993.
- warwick@cs.uq.oz.au
-
- COPYING
- This functionality is part of the GEM++ library,
- and is Copyright 1993 by Warwick W. Allison.
-
- GEM++ is free and protected under the GNU Library General Public
- License.
-
- You are free to copy and modify these sources, provided you
- acknowledge the origin by retaining this notice, and adhere to
- the conditions described in the GNU LGPL.
-